const { upload } = require('../model/type.model');

class CommonService {
  // 查询类型列表
  async updateFile({id, paths }) {
    const params = {}
    const whereOpt = {}

    id && Object.assign(whereOpt, { id })

    title && Object.assign(params, { title })
    content && Object.assign(params, { content })
    tag_id && Object.assign(params, { tag_id })
    sort_id && Object.assign(params, { sort_id })

    const res = await update('b_article', params, whereOpt)
    return res
  }
  
}

module.exports = new CommonService();
